import Vue from 'vue'
import VueRouter from 'vue-router'

Vue.use(VueRouter)

const routes = [
  {
    path: "/",
    name: "index",
    component: () => import("../pages/index.vue"),
  },
  {
    path: "/contract",
    name: "contract",
    component: () => import("../pages/contract.vue"),
  },
  {
    path: "/home",
    name: 'home',
    component: () => import("../pages/home.vue"),
    children:[
      {
        path: "/",
        name: "wChat",
        component: () => import("../pages/robot/wChat.vue"),
        meta: {
          title: "AI客服配置",
          subtitle: "微信列表"
        }
      },
      {
        path: "/wChat",
        name: "wChat",
        component: () => import("../pages/robot/wChat.vue"),
        meta: {
          title: "AI客服配置",
          subtitle: "微信列表"
        }
      },
      {
        path: "/repository",
        name: "repository",
        component: () => import("../pages/robot/repository.vue"),
        meta: {
          title: "AI客服配置",
          subtitle: "知识库列表"
        }
      },
      {
        path: "/manage",
        name: "manage",
        component: () => import("../pages/robot/manage.vue"),
        meta: {
          title: "知识库",
          subtitle: "知识库管理",
          isBack: true
        }
      },
      {
        path: "/chat",
        name: "chat",
        component: () => import("../pages/chat/chat.vue"),
        meta: {
          title: "聊天管理",
          subtitle: "聊天会话"
        }
      },
      {
        path: "/mass_texting",
        name: "mass_texting",
        component: () => import("../pages/chat/mass_texting.vue"),
        meta: {
          title: "聊天管理",
          subtitle: "群发"
        }
      },
      {
        path: "/timing_message",
        name: "timing_message",
        component: () => import("../pages/chat/timing_message.vue"),
        meta: {
          title: "聊天管理",
          subtitle: "定时消息"
        }
      },
      {
        path: "/latest",
        name: "latest",
        component: () => import("../pages/chat/latest.vue"),
        meta: {
          title: "聊天管理",
          subtitle: "跟进列表"
        }
      },
      {
        path: "/report",
        name: "report",
        component: () => import("../pages/chat/report.vue"),
        meta: {
          title: "聊天管理",
          subtitle: "报表设置",
          isBack: true
        }
      },
      {
        path: "/prologue",
        name: "prologue",
        component: () => import("../pages/chat/prologue.vue"),
        meta: {
          title: "聊天管理",
          subtitle: "开场白设置"
        }
      },
      {
        path: "/addFriend",
        name: "addFriend",
        component: () => import("../pages/chat/addFriend.vue"),
        meta: {
          title: "聊天管理",
          subtitle: "自动加好友"
        }
      },
      {
        path: "/advanced_setup",
        name: "advanced_setup",
        component: () => import("../pages/chat/advanced_setup.vue"),
        meta: {
          title: "聊天管理",
          subtitle: "高级设置"
        }
      },
      {
        path: "/my_service",
        name: "my_service",
        component: () => import("../pages/person/my_service.vue"),
        meta: {
          title: "我的",
          subtitle: "我的服务"
        }
      },
      {
        path: "/sub_account",
        name: "sub_account",
        component: () => import("../pages/person/sub_account.vue"),
        meta: {
          title: "我的",
          subtitle: "我的子账号"
        }
      },
      {
        path: "/setup",
        name: "setup",
        component: () => import("../pages/person/setup.vue"),
        meta: {
          title: "我的",
          subtitle: "账号设置"
        }
      },
    ]
  },
  {
    path: "/login",
    name: "login",
    component: () => import("../pages/login.vue"),
  },
  {
    path: "/invite",
    name: "invite",
    component: () => import("../pages/invite.vue"),
  }
]

const router = new VueRouter({
  routes
})

export default router
